﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Libero.FusionCharts;

namespace WebApplication1
{
    public partial class exemplo_MS_Manual : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MSColumn3DChart oChart = new MSColumn3DChart();

            // Set properties
            oChart.Background.BgColor = "ffffff";
            oChart.Background.BgAlpha = 50;
            oChart.ChartTitles.Caption = "Categories by country";
            oChart.ChartTitles.SubCaption = "Annual report (US$)";

            // Set a template
            oChart.Template = new Libero.FusionCharts.Template.OceanTemplate();

            // Set data
            // Add Categories Data.
            oChart.CategorySet.FontColor = "0000FF";
            oChart.CategorySet.CategoryElementSet.Add(new MSCategoryElement("Brazil"));
            oChart.CategorySet.CategoryElementSet.Add(new MSCategoryElement("India"));
            oChart.CategorySet.CategoryElementSet.Add(new MSCategoryElement("China"));

            // Add Series data in the correct order.
            MSDataSet msDs;
            msDs = new MSDataSet("Eletronics", "ff0000");
            msDs.SetElementSet.Add(new MSSetElement(15000));
            msDs.SetElementSet.Add(new MSSetElement(30000));
            msDs.SetElementSet.Add(new MSSetElement(45000));
            oChart.DataSetList.Add(msDs);

            msDs = new MSDataSet("Computers", "00ff00");
            msDs.SetElementSet.Add(new MSSetElement(80000));
            msDs.SetElementSet.Add(new MSSetElement(50000));
            msDs.SetElementSet.Add(new MSSetElement(20000));
            oChart.DataSetList.Add(msDs);

            msDs = new MSDataSet("Mobiles", "0000ff");
            msDs.SetElementSet.Add(new MSSetElement(15000));
            msDs.SetElementSet.Add(new MSSetElement(30000));
            msDs.SetElementSet.Add(new MSSetElement(70000));
            oChart.DataSetList.Add(msDs);


            // Link the WebControl and the Chart
            chtProductSales.ShowChart(oChart);
        }
    }
}